﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.IO;
using System.Reflection.Emit;
using System.Reflection;
using System.Threading;
using System.Diagnostics;
using System.Collections.Concurrent;
using PServiceBus.Core.Logger;
using PServiceBus.Core.Runtime.Extensions;

namespace PServiceBus.Core.Runtime {
    public class Parser {

        public const BindingFlags BINDING =
            BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
        private readonly static Type _voidType = typeof(void);
        private static object _lockObject = null;
        private static int _version = 300;
        private static int _size = 10;
        private static int _codeSize = 1000;
        private static Func<string, string, string> _func = null;

        private static ConcurrentDictionary<string, Delegate> _delegates =
            new ConcurrentDictionary<string, Delegate>();

        public static ConcurrentDictionary<string, OpCode> _opCodes = 
            new ConcurrentDictionary<string, OpCode>();

        [DllImport("psb_decrypter.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "ParseString")]
        public static extern IntPtr ParseStringEx(string str);


        public static string ParseString(string str) {
            return Marshal.PtrToStringAnsi(ParseStringEx(str));
        }

        static Parser() {
            try {
                _opCodes = new ConcurrentDictionary<string, OpCode>(
                    typeof(OpCodes).GetFields().Select(x => (OpCode)x.GetValue(null))
                    .ToDictionary(x => x.Name.ToLower(), x => x));
                InitParser();
                Initialize();
            } catch (Exception ex) {
                ESBLogger.Log(ex);
                throw;
            }
        }

        private static void InitParser() {
            var data = new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 
            0x64, 0x76, 0x65, 0x64, 0x65, 0x76};
            var asms = AppDomain.CurrentDomain.GetAssemblies();
            var ktpolol = ParseString("x94-x-zz-z");
            var kvbkld = asms.Where(x => x.FullName.StartsWith(ktpolol)).FirstOrDefault();
            var qxlo = Type.GetType(ParseString("x94-x--x") + ParseString("551xxcv"));
            var pokoko = Type.GetType(ParseString("x94-x--x") + ParseString("j8-1294x@"));
            var wcllolo = Type.GetType(ParseString("x94-x--x") + 
                ParseString("--|--2--#$-")).MakeArrayType();
            var method = new DynamicMethod("aaaafxaa", qxlo,
                new[] { qxlo, qxlo }, true);

            var il = method.GetILGenerator();
            var xkjiom = il.DeclareLocal(wcllolo);
            var lkknn = il.DeclareLocal(xkjiom.LocalType);
            var pjnax = il.DeclareLocal(kvbkld.GetType(ParseString("---")));
            var nheru = il.DeclareLocal(kvbkld.GetType(ParseString("----")));
            var kbuio = il.DeclareLocal(kvbkld.GetType(ParseString("-----")));
            var oiuii = il.DeclareLocal(kvbkld.GetType(ParseString("------")));
            var acxs = il.DeclareLocal(lkknn.LocalType);
            var kijiji = acxs.LocalType.GetElementType();
            il.Emit(Parser.O("19."), 13);
            il.Emit(Parser.O("-17"), kijiji);
            il.Emit(Parser.O("-11"), acxs.LocalIndex);
            for (var i = 0; i < data.Length; i++) {
                il.Emit(Parser.O("--12--"), acxs.LocalIndex);
                il.Emit(OpCodes.Ldc_I4_S, i);
                il.Emit(OpCodes.Ldc_I4_S, data[i]);
                il.Emit(OpCodes.Stelem, kijiji);
            }
            il.Emit(Parser.O("23.-"));
            il.Emit(Parser.O("2--"), kvbkld.GetType(ParseString("-------w")).GetMethod(ParseString("..")));
            il.Emit(Parser.O("-11"), xkjiom.LocalIndex);
            il.Emit(OpCodes.Ldarg_1);
            il.Emit(Parser.O("--12--"), acxs.LocalIndex);
            il.Emit(Parser.O("21.-"), pjnax.LocalType.GetConstructor(new[] { qxlo, lkknn.LocalType }));
            il.Emit(Parser.O("-11"), pjnax.LocalIndex);
            il.Emit(Parser.O("21.-"), nheru.LocalType.GetConstructor(Type.EmptyTypes));
            il.Emit(Parser.O("-11"), nheru.LocalIndex);
            il.Emit(Parser.O("2--"), kbuio.LocalType.GetMethod(ParseString("..."), Type.EmptyTypes));
            il.Emit(Parser.O("-11"), kbuio.LocalIndex);
            il.Emit(Parser.O("--12--"), kbuio.LocalIndex);
            il.Emit(Parser.O("--12--"), pjnax.LocalIndex);
            il.Emit(Parser.O("19."), 32);
            il.Emit(Parser.O("3-"), pjnax.LocalType.GetMethod(ParseString("....-")));
            il.Emit(Parser.O("3-"), kbuio.LocalType.GetProperty(ParseString("-..-..-")).GetSetMethod());
            il.Emit(Parser.O("--12--"), kbuio.LocalIndex);
            il.Emit(Parser.O("--12--"), pjnax.LocalIndex);
            il.Emit(Parser.O("19."), 16);
            il.Emit(Parser.O("3-"), pjnax.LocalType.GetMethod(ParseString("....-")));
            il.Emit(Parser.O("3-"), kbuio.LocalType.GetProperty(ParseString("...---...")).GetSetMethod());
            il.Emit(Parser.O("--12--"), nheru.LocalIndex);
            il.Emit(Parser.O("--12--"), kbuio.LocalIndex);
            il.Emit(Parser.O("3-"), kbuio.LocalType.GetMethod(ParseString(";;;;"), Type.EmptyTypes));
            il.Emit(Parser.O("1---"));
            il.Emit(Parser.O("21.-"), oiuii.LocalType.GetConstructor(new[]{ kvbkld.GetType(ParseString(";.;..;")),
                kvbkld.GetType(ParseString(";;-")),
                kvbkld.GetType(ParseString(";....")) }));
            il.Emit(Parser.O("-11"), oiuii.LocalIndex);
            il.Emit(Parser.O("--12--"), oiuii.LocalIndex);
            il.Emit(Parser.O("--12--"), xkjiom.LocalIndex);
            il.Emit(Parser.O("20.-"));
            il.Emit(Parser.O("--12--"), xkjiom.LocalIndex);
            il.Emit(OpCodes.Ldlen);
            il.Emit(OpCodes.Conv_I4);
            il.Emit(Parser.O("3-"), oiuii.LocalType.GetMethod(ParseString(".z..z..zzz"), new[] { lkknn.LocalType, pokoko, pokoko }));
            il.Emit(Parser.O("--12--"), oiuii.LocalIndex);
            il.Emit(Parser.O("3-"), oiuii.LocalType.GetMethod(ParseString(",.,,,,")));
            il.Emit(Parser.O("--12--"), nheru.LocalIndex);
            il.Emit(Parser.O("3-"), nheru.LocalType.GetMethod(ParseString(",,...,,,,")));
            il.Emit(Parser.O("-11"), lkknn.LocalIndex);
            il.Emit(Parser.O("2--"), kvbkld.GetType(ParseString("@...@...@..;;")).GetProperty(ParseString("!!!!~~~!~~~!...")).GetGetMethod());
            il.Emit(Parser.O("--12--"), lkknn.LocalIndex);
            il.Emit(Parser.O("3-"), kvbkld.GetType(ParseString("@...@...@..;;")).GetMethod(ParseString("!!!!:::!!!!::!!"), new[] { xkjiom.LocalType }));
            il.Emit(OpCodes.Ret);
            _func = method.CreateDelegate(typeof(Func<string, string, string>))
                as Func<string, string, string>;
        }

        public static OpCode O(string name) {
            return _opCodes[Parser.ParseString(name)];
        }

        public static T InvokeEx<T>(string name, Action<ILGenerator> action) where T : class {
            return Invoke(name, typeof(T), il => {
                var fxcvs = AppDomain.CurrentDomain.GetAssemblies().Where(x =>
                    x.FullName.StartsWith(ParseString("x94-x-zz-z")))
                    .FirstOrDefault();
                var clcssc = Type.GetType(ParseString("x94-x--x") + ParseString("jxk932"));
                var cclmxcm = Type.GetType(ParseString("x94-x--x") + ParseString("j8-1294x@"));
                var lkckolk = Type.GetType(ParseString("x94-x--x") + ParseString("551xxcv"));
                var okcxmxkvv = fxcvs.GetType(ParseString("-000-xv-dj"));
                var vx32vxc = okcxmxkvv.MakeGenericType(cclmxcm, clcssc, clcssc, lkckolk);
                var covikicookies = fxcvs.GetType(ParseString("K##$$$"));
                var vanilio = covikicookies.GetMethod(ParseString("C$D%^CD"), BINDING, null,
                    new[] { cclmxcm }, null);
                var ouhemkpp = Assembly.GetExecutingAssembly()
                    .GetType(ParseString("kvppcarppe"));
                var kcokedirnk = ouhemkpp.GetField(ParseString("mysckookyyy"), BINDING);
                var kcbreakfatrnk = ouhemkpp.GetField(ParseString("Kv66@kC)F_)("), BINDING);
                var djzxckUJcck = ouhemkpp.GetField(ParseString("@!#^&)))F)("), BINDING);
                
                var kcx5023 = il.DefineLabel();
                var kcree342 = il.DefineLabel();
                
                il.Emit(Parser.O("-1.5-"));
                il.Emit(Parser.O("3-"), vx32vxc.GetProperty(ParseString("5kkc---d")).GetGetMethod());
                il.Emit(Parser.O("--6"), kcokedirnk);
                il.Emit(Parser.O("5-"));
                il.Emit(Parser.O("-13--"), kcx5023);
                il.Emit(Parser.O("--6"), djzxckUJcck);
                il.Emit(Parser.O("--6"), kcokedirnk);
                il.Emit(Parser.O("4-----"));
                il.Emit(Parser.O("2--"), vanilio);
                il.Emit(Parser.O("1---"));
                il.Emit(Parser.O("-1-4-"));
                il.MarkLabel(kcx5023);
                il.Emit(Parser.O("-1.5-"));
                il.Emit(Parser.O("3-"), vx32vxc.GetProperty(ParseString("5kkc---d")).GetGetMethod());
                il.Emit(Parser.O("--6"), kcbreakfatrnk);
                il.Emit(Parser.O("5-"));
                il.Emit(Parser.O("-13--"), kcree342);
                il.Emit(Parser.O("--6"), djzxckUJcck);
                il.Emit(Parser.O("--6"), kcbreakfatrnk);
                il.Emit(Parser.O("4-----"));
                il.Emit(Parser.O("2--"), vanilio);
                il.Emit(Parser.O("1---"));
                il.Emit(Parser.O("-1-4-"));
                il.MarkLabel(kcree342);
                action(il);
            }) as T;
        }
        
        public static T Invoke<T>(string name, Action<ILGenerator> action) where T : class {
            return Invoke(name, typeof(T), action) as T;
        }

        private static Delegate Invoke(string name, Type type, Action<ILGenerator> action) {
            return _delegates.GetOrAdd(name, k => {
                var arguments = type.IsGenericType ? type.GetGenericArguments() : null;
                var returnType = type.Name.Contains("Action") ? _voidType : arguments[arguments.Length - 1];
                var method = new DynamicMethod(k, returnType, arguments, true);
                var clcssc = Type.GetType(ParseString("x94-x--x") + ParseString("jxk932"));
                var cclmxcm = Type.GetType(ParseString("x94-x--x") + ParseString("j8-1294x@"));
                var lkckolk = Type.GetType(ParseString("x94-x--x") + ParseString("551xxcv"));
                var fkcokekpefsi = Type.GetType(ParseString("-$$RRR$%%%$)_"));
                var fxcvs = AppDomain.CurrentDomain.GetAssemblies().Where(x =>
                    x.FullName.StartsWith(ParseString("x94-x-zz-z")))
                    .FirstOrDefault();
                var vxcpo00es = AppDomain.CurrentDomain.GetAssemblies().Where(x =>
                    x.FullName.StartsWith(ParseString("x94-x-yy-x")))
                    .FirstOrDefault();
                var kv0k0ppcx98 = vxcpo00es.GetType(ParseString("jkcxvrr"));
                var cfc22dvbcx = Assembly.GetExecutingAssembly()
                .GetType(ParseString("kvppcarppe"));
                var yh53dcLk = Assembly.GetExecutingAssembly()
                    .GetType(ParseString("kvppcarppe"));
                var okcxmxkvv = fxcvs.GetType(ParseString("-000-xv-dj"));
                var vx32vxc = okcxmxkvv.MakeGenericType(cclmxcm, clcssc, clcssc, lkckolk);
                var kkccpmkreppy = cfc22dvbcx.GetField(ParseString("vvkklllicky"), BINDING);
                var gh98fcoff = yh53dcLk.GetField(ParseString("mysckookyyy"), BINDING);
                var y2f56vccc = yh53dcLk.GetField(ParseString("Kv66@kC)F_)("), BINDING);
                var il = method.GetILGenerator();
                var kc0of = il.DeclareLocal(vx32vxc);
                var vmkskffmmv = il.DeclareLocal(fkcokekpefsi);
                var kmxo0id = il.DeclareLocal(clcssc);
                var hfv4dcx4 = il.DefineLabel();
                var y6fc12fd = il.DefineLabel();
                var klclibk = il.DefineLabel();
                var klgglgf = il.DefineLabel();

                il.Emit(Parser.O("20.-"));
                il.Emit(Parser.O("-11"), vmkskffmmv.LocalIndex);
                il.Emit(Parser.O("--6"), kkccpmkreppy);
                il.Emit(OpCodes.Isinst, vx32vxc);
                il.Emit(Parser.O("-11"), kc0of.LocalIndex);
                il.Emit(Parser.O("2--"), clcssc.GetProperty(ParseString("nlxvldkoclcxn"),
                     BINDING).GetGetMethod());
                il.Emit(Parser.O("-11"), kmxo0id.LocalIndex);
                il.Emit(Parser.O("--12--"), kmxo0id.LocalIndex);
                il.Emit(Parser.O("--12--"), kc0of.LocalIndex);
                il.Emit(Parser.O("3-"), vx32vxc.GetProperty(ParseString("9kfc---dx"))
                    .GetGetMethod());
                il.Emit(Parser.O("2--"), clcssc.GetMethod(ParseString("klllclcxll"), BINDING));
                il.Emit(Parser.O("-13--"), klclibk);
                il.Emit(Parser.O("2--"), kv0k0ppcx98.GetMethod(ParseString("gcdtoop"),
                    BINDING));
                il.Emit(Parser.O("3-"), kv0k0ppcx98.GetMethod(ParseString("jcknklck")));
                il.MarkLabel(klclibk);
                il.Emit(Parser.O("--12--"), kmxo0id.LocalIndex);
                il.Emit(Parser.O("--12--"), kc0of.LocalIndex);
                il.Emit(Parser.O("3-"), vx32vxc.GetProperty(ParseString("8hkc---dy"))
                    .GetGetMethod());
                il.Emit(Parser.O("2--"), clcssc.GetMethod(ParseString("klglglcglg"), BINDING));
                il.Emit(Parser.O("-13--"), klgglgf);
                il.Emit(Parser.O("2--"), kv0k0ppcx98.GetMethod(ParseString("gcdtoop"),
                    BINDING));
                il.Emit(Parser.O("3-"), kv0k0ppcx98.GetMethod(ParseString("jcknklck")));
                il.MarkLabel(klgglgf);
                il.Emit(Parser.O("-1.5-"));
                il.Emit(Parser.O("3-"), vx32vxc.GetProperty(ParseString("5kkc---d")).GetGetMethod());
                il.Emit(Parser.O("--6"), gh98fcoff);
                il.Emit(Parser.O("5-"));
                il.Emit(Parser.O("-13--"), hfv4dcx4);
                il.Emit(Parser.O("1---"));
                il.Emit(Parser.O("-1-4-"));
                il.MarkLabel(hfv4dcx4);
                il.Emit(Parser.O("-1.5-"));
                il.Emit(Parser.O("3-"), vx32vxc.GetProperty(ParseString("5kkc---d")).GetGetMethod());
                il.Emit(Parser.O("--6"), y2f56vccc);
                il.Emit(Parser.O("5-"));
                il.Emit(Parser.O("-13--"), y6fc12fd);
                il.Emit(Parser.O("1---"));
                il.Emit(Parser.O("-1-4-"));
                il.MarkLabel(y6fc12fd);
                action(il);
                il.Emit(OpCodes.Ret);
                return method.CreateDelegate(type);
            });
        }

        private static void Initialize() {
            var kss = AppDomain.CurrentDomain.GetAssemblies().Where(x =>
                x.FullName.StartsWith(ParseString("x94-x-yy-x")))
                .FirstOrDefault();
            var kcss = AppDomain.CurrentDomain.GetAssemblies().Where(x =>
                x.FullName.StartsWith(ParseString("x94-x-zz-z")))
                .FirstOrDefault();

            var ascmk = AppDomain.CurrentDomain.GetAssemblies()
                    .FirstOrDefault(x => x.FullName.StartsWith("System.Core"));


            var kvqq = kcss.GetType(ParseString("-000-xv-dj"));
            var kxd = Type.GetType(ParseString("x94-x--x") + ParseString("jxk932"));
            var kcc = Type.GetType(ParseString("x94-x--x") + ParseString("j8-1294x@"));
            var kxc = Type.GetType(ParseString("x94-x--x") + ParseString("551xxcv"));
            var mkvm = kss.GetType(ParseString("@$56x566"));
            var mkvmm = mkvm.GetProperty(ParseString("yy0y0")).GetGetMethod();
            var mggkgg = kss.GetType(ParseString("@$gggg6"));
            var mggkggkv = mggkgg.GetProperty(ParseString("707^Yyyr")).GetGetMethod();
            var gkmg = kss.GetType(ParseString("@$g6g6"));
            var mkcmm = kss.GetType(ParseString("@$5xx66"));
            var mkvbbb = mkcmm.GetMethod(ParseString("cfgeim"));
            var kggqq = kvqq.MakeGenericType(kcc, kxd, kxd, kxc);
            var kvcvvccvv = Type.GetType(ParseString("kvcckhkrk")).MakeArrayType();
            var kckpppcppp = kss.GetType(ParseString("jkcxvrr"));
            var pdemrepp = Assembly.GetExecutingAssembly()
                .GetType(ParseString("kvppcarppe"));
            var kkccpmkreppy = pdemrepp.GetField(ParseString("vvkklllicky"), BINDING);
            var gclcolcffii = pdemrepp.GetField(ParseString("@!#^&)))F)("), BINDING);
            var jucfqqDFvx = pdemrepp.GetField(ParseString("mysckookyyy"), BINDING);
            var cvkOF2kvll = pdemrepp.GetField(ParseString("Kv66@kC)F_)("), BINDING);

            var gmkgm = gkmg.GetMethod(ParseString("cfgeim"),
                new[] { kxc });
            var kscs = kxc.GetMethod(ParseString("x121ds"),
                new[] { kcc, kcc });
            var krcxr = kxc.GetMethod(ParseString("cxvxc4"),
                new[] { kcc, kcc });

            var xrvxc = ascmk.GetType(Parser.ParseString("6-6-43000--###$%)===050")).GetMethod(ParseString("Lj3465"),
                BINDING).MakeGenericMethod(typeof(char));

            var ghkggg = kxc.GetGenericMethod(ParseString("xc043-e"),
                new[] { kxc, typeof(IEnumerable<char>) })
                .MakeGenericMethod(typeof(char));
            
            var xccc = kxc.GetMethod(ParseString("7#$524"),
                BINDING, null, new[] { kxc, kxc }, null);
            var method = new DynamicMethod("xfsdf",
                  typeof(void), new []{ typeof(Func<string, string, string>) }, true);

            var il = method.GetILGenerator();
            var lxlcm = il.DeclareLocal(mkcmm);
            var licit = il.DeclareLocal(kxc);
            var kpoy = il.DeclareLocal(kxc);
            var ll = il.DeclareLocal(kcc);
            var ff = il.DeclareLocal(kxc);
            var ss = il.DeclareLocal(kxc);
            var kk = il.DeclareLocal(kxc);
            var pkkk = il.DeclareLocal(kxc);
            var klcll = il.DeclareLocal(kxc);
            var ikvkfi = il.DefineLabel();
            var kfttktt = il.DeclareLocal(kggqq);
            var kcrarkc = il.DeclareLocal(kxc.MakeArrayType());
            var krrcckckc = il.DeclareLocal(kvcvvccvv);
            var dkklloi = il.DeclareLocal(kxc);


            il.Emit(Parser.O("-8-"), ParseString("mc1-2--1"));
            il.Emit(Parser.O("2--"), kcss.GetType(ParseString("xx-$$-x"))
                .GetMethod(ParseString("cv56891`"),
                BINDING, null, new[] { kxc }, null));
            il.Emit(Parser.O("-8-"), ParseString("xrkcpp"));
            il.Emit(Parser.O("2--"), kss.GetType(ParseString("@$5666"))
                .GetMethod(ParseString("9@#9-"),
                BINDING, null, new[] { kxc, kxc }, null));
            il.Emit(Parser.O("-11"), lxlcm.LocalIndex);
            il.Emit(Parser.O("--12--"), lxlcm.LocalIndex);
            il.Emit(Parser.O("20.-"));
            il.Emit(Parser.O("3-"), mkvbbb);
            il.Emit(Parser.O("3-"), mkvmm);
            il.Emit(Parser.O("-8-"), ParseString("707^Yyyr"));
            il.Emit(Parser.O("3-"), gmkgm);
            il.Emit(Parser.O("3-"), mggkggkv);
            il.Emit(Parser.O("-11"), licit.LocalIndex);
            il.Emit(Parser.O("--12--"), lxlcm.LocalIndex);
            il.Emit(Parser.O("1---"));
            il.Emit(Parser.O("3-"), mkvbbb);
            il.Emit(Parser.O("3-"), mkvmm);
            il.Emit(Parser.O("-8-"), ParseString("707^Yyyr"));
            il.Emit(Parser.O("3-"), gmkgm);
            il.Emit(Parser.O("3-"), mggkggkv);
            il.Emit(Parser.O("-11"), kpoy.LocalIndex);
            il.Emit(Parser.O("--12--"), licit.LocalIndex);
            il.Emit(Parser.O("3-"), kxc.GetProperty(ParseString("71xxew")).GetGetMethod());
            il.Emit(Parser.O("-11"), ll.LocalIndex);
            il.Emit(Parser.O("-8-"), "");
            il.Emit(Parser.O("--12--"), kpoy.LocalIndex); 
            il.Emit(Parser.O("-16-"));
            il.Emit(Parser.O("-16-"));
            il.Emit(Parser.O("3-"), kscs);
            il.Emit(Parser.O("-11"), ff.LocalIndex);
            il.Emit(Parser.O("--12--"), kpoy.LocalIndex);
            il.Emit(Parser.O("--12--"), ll.LocalIndex);
            il.Emit(Parser.O("-16-"));
            il.Emit(Parser.O("3-"), kscs);
            il.Emit(Parser.O("-11"), ss.LocalIndex);
            il.Emit(Parser.O("--12--"), ff.LocalIndex);
            il.Emit(Parser.O("--12--"), ss.LocalIndex);
            il.Emit(Parser.O("2--"), xccc);
            il.Emit(Parser.O("2--"), xrvxc);
            il.Emit(Parser.O("2--"), ghkggg);
            il.Emit(Parser.O("-11"), kk.LocalIndex);
            il.Emit(Parser.O("23.-"));
            il.Emit(Parser.O("--12--"), kpoy.LocalIndex);
            il.Emit(Parser.O("--12--"), ll.LocalIndex);
            il.Emit(Parser.O("-16-"));
            il.Emit(Parser.O("3-"), krcxr);
            il.Emit(Parser.O("-16-"));
            il.Emit(Parser.O("-16-"));
            il.Emit(Parser.O("3-"), krcxr);
            il.Emit(Parser.O("--12--"), kk.LocalIndex);
            il.Emit(Parser.O("-8-"), ParseString("jxcv4453"));
            il.Emit(Parser.O("2--"), xccc);
            il.Emit(Parser.O("3-"), typeof(Func<string, string, string>).GetMethod("Invoke"));
            il.Emit(Parser.O("-11"), klcll.LocalIndex);
            il.Emit(Parser.O("--12--"), kk.LocalIndex);
            il.Emit(Parser.O("-8-"), ParseString("jcg788u"));
            il.Emit(Parser.O("2--"), xccc);
            il.Emit(Parser.O("--12--"), klcll.LocalIndex);
            il.Emit(Parser.O("2--"), xccc);
            il.Emit(Parser.O("1---"));
            il.Emit(Parser.O("-17"), kvcvvccvv.GetElementType());
            il.Emit(Parser.O("-11"), krrcckckc.LocalIndex);
            il.Emit(Parser.O("--12--"), krrcckckc.LocalIndex);
            il.Emit(Parser.O("20.-"));
            il.Emit(Parser.O("19."),
                (int)ParseString("jcg788u").ToCharArray()[0]);
            il.Emit(Parser.O("-18"));
            il.Emit(Parser.O("--12--"), krrcckckc.LocalIndex);
            il.Emit(Parser.O("3-"), kxc.GetMethod(ParseString("tycx1Mxs"),
                new[] { kvcvvccvv }));
            il.Emit(Parser.O("-11"), kcrarkc.LocalIndex);
            il.Emit(Parser.O("--12--"), kcrarkc.LocalIndex);
            il.Emit(Parser.O("20.-"));
            il.Emit(Parser.O("-9"), kxc);
            il.Emit(Parser.O("2--"), kcc.GetMethod(ParseString("cvppgr891"),
                BINDING, null, new[] { kxc }, null));
            il.Emit(Parser.O("--12--"), kcrarkc.LocalIndex);
            il.Emit(Parser.O("-16-"));
            il.Emit(Parser.O("-9"), kxc);

            il.Emit(Parser.O("-8-"), ParseString("fin>><<..."));
            il.Emit(Parser.O("2--"), kcss.GetType(ParseString("k--|||||"))
                .GetMethod(ParseString(">>>><<..>>"), BINDING, null, new[] { kxc }, null));
            
            il.Emit(Parser.O("2--"), kxd.GetMethod(ParseString("cvppgr891"),
                BINDING, null, new[] { kxc, kcss.GetType(ParseString("<<.<..f>n>><<...")) }, null));
            il.Emit(Parser.O("--12--"), kcrarkc.LocalIndex);
            il.Emit(Parser.O("19."), 3);
            il.Emit(Parser.O("-9"), kxc);


            il.Emit(Parser.O("-8-"), ParseString("fin>><<..."));
            il.Emit(Parser.O("2--"), kcss.GetType(ParseString("k--|||||"))
                .GetMethod(ParseString(">>>><<..>>"), BINDING, null, new[] { kxc }, null));
           
            il.Emit(Parser.O("2--"), kxd.GetMethod(ParseString("cvppgr891"),
                BINDING, null, new[] { kxc, kcss.GetType(ParseString("<<.<..f>n>><<...")) }, null));
            il.Emit(Parser.O("--12--"), kcrarkc.LocalIndex);
            il.Emit(Parser.O("19."), 4);
            il.Emit(Parser.O("-9"), kxc);
            il.Emit(Parser.O("21.-"), kggqq.GetConstructors()[0]);
            il.Emit(Parser.O("-11"), kfttktt.LocalIndex);
            il.Emit(Parser.O("--12--"), kcrarkc.LocalIndex);
            il.Emit(Parser.O("19."), 4);
            il.Emit(Parser.O("-9"), kxc);
            il.Emit(Parser.O("--12--"), licit.LocalIndex);
            il.Emit(Parser.O("2--"), kxc.GetMethod(ParseString("ekvkekieki"), BINDING));
            il.Emit(Parser.O("20.-"));
            il.Emit(Parser.O("5-"));
            il.Emit(Parser.O("-10"), ikvkfi);
            il.Emit(Parser.O("2--"), kckpppcppp.GetMethod(ParseString("gcdtoop"), BINDING));
            il.Emit(Parser.O("3-"), kckpppcppp.GetMethod(ParseString("jcknklck")));
            il.MarkLabel(ikvkfi);
            il.Emit(Parser.O("--12--"), kfttktt.LocalIndex);
            il.Emit(Parser.O("7--"), kkccpmkreppy);
            il.Emit(Parser.O("-8-"), ParseString("940-oco1094ro"));
            il.Emit(Parser.O("2--"), kcc.GetMethod(ParseString("cvppgr891"),
                BINDING, null, new[] { kxc }, null)); 
            il.Emit(Parser.O("7--"), jucfqqDFvx);
            il.Emit(Parser.O("-8-"), ParseString("--cvxoo--5%%%#o"));
            il.Emit(Parser.O("2--"), kcc.GetMethod(ParseString("cvppgr891"),
                BINDING, null, new[] { kxc }, null));
            il.Emit(Parser.O("7--"), cvkOF2kvll);
            il.Emit(Parser.O("-8-"), ParseString("----%%%#---#"));
            il.Emit(Parser.O("2--"), kcc.GetMethod(ParseString("cvppgr891"),
                BINDING, null, new[] { kxc }, null));
            il.Emit(Parser.O("7--"), gclcolcffii);
            il.Emit(OpCodes.Ret);
            (method.CreateDelegate(typeof(Action<Func<string, string, string>>))
                as Action<Func<string, string, string>>)(_func);
        }
    }
}
